package com.BlogPark.mapper;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * @Auther: MFM
 * @Date: 2022/8/15 - 08 - 15 - 22:05
 * @version: 1.0
 */

@Component
public interface LikesMapper {

    //通过文章/评论id获取点赞数
    Integer getLikes(String headTo);

    //查看用户是否点赞
    Integer getUserLikes(@Param("userId") Integer userId, @Param("headTo") String headTo);

    //点赞
    void addLike(@Param("userId") Integer userId, @Param("articleId") String articleId);

    //如果已经点过赞 再点就会取消点赞
    void deleteLike(@Param("userId") Integer userId, @Param("articleId") String articleId);
}
